1. Technical Field
The present invention relates in general to a data processing system and, in particular, to a method and system for performance monitoring within a data processing system. Still more particularly, the present invention relates to a method and system for performance monitoring that permit selection of a granularity and range when counting occurrences of events subject to a threshold.
2. Description of the Related Art
Within a state-of-the-art processor, facilities are often provided that enable the processor to count occurrences of selected events and thereby obtain a quantitative description of the operation of a data processing system. These facilities are generally referred to as a performance monitor.
A conventional performance monitor includes at least one control register and one or more counters. The control register is typically comprised of a plurality of bit fields, which are set to specified values in order to select the events to be monitored and to specify the conditions under which the counters are enabled. Occurrences of the selected events can then be counted by the performance monitor counters.
Because both the number of events available for monitoring and the number of occurrences of monitored events may be large, it is desirable for performance monitors to employ a large (e.g., 32 or 64-bit) control register and large counters. In addition, because each counter typically records occurrences of only a single specified event, it is desirable to have a large number of counters in order to provide a broad description of data processing system performance. However, because the added functionality provided by a large control register and multiple large counters increases a processor's die size and therefore cost, the size and number of performance monitor control registers and counters are generally somewhat restricted due to economic considerations.
The present invention includes the recognition that, while a performance monitor may have limited control register and/or counter sizes, it is desirable for the performance monitor control register and counters to support large ranges when a large number of event occurrences are to be specified or counted. Similarly, when a fewer number of events are to be specified or counted, it is desirable for the control register and counters to have small granularities. Conventional performance monitors, however, do not provide control registers and counters that support both large ranges and small granularities. Consequently, it would be desirable to provide an improved performance monitor having such capabilities.